package wyn.spec.edu.week12_class01;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.List;

public class ActivityFirst extends AppCompatActivity {
    private List<wechat> wechatList=new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);
        initWechat();
        WeChatAdapter adapter=new WeChatAdapter(ActivityFirst.this,R.layout.wechat_item,wechatList);
        ListView listView=(ListView) findViewById(R.id.wechatList);
        listView.setAdapter(adapter);

    }

    private void initWechat() {
        for(int i=0;i<2;i++){
            wechat a = new wechat("订阅号消息","小新说车：什么是小众豪华车，这俩车能回答",R.drawable.a);
            wechatList.add(a);
            wechat b = new wechat("指端云", "这个秋冬他们相继离世，癌症究竟是怎么摧...",R.drawable.b);
            wechatList.add(b);
            wechat c = new wechat("微信收款助手","微信支付收款4:00元", R.drawable.c);
            wechatList.add(c);
            wechat d = new wechat("金大师为民服务","机构师说：[语音]", R.drawable.d);
            wechatList.add(d);
            wechat e = new wechat("春晖花园客户服务中心","[10条]春晖花园客服中心：@3_1_903",R.drawable.e);
            wechatList.add(e);
            wechat f = new wechat("奋斗的小仙女","@所有人",R.drawable.f);
            wechatList.add(f);
            wechat g = new wechat("微信团队", "操作通知",R.drawable.g);
            wechatList.add(g);
            wechat h = new wechat("fight","@所有人", R.drawable.h);
            wechatList.add(h);


        }
    }

}
